$(document).ready(function(){
	$('#grid_news').datagrid({ 
		url:"findNewsList.html",
		fit:true,
		fitColumns:true, 
		singleSelect:true,
		pageSize:10,   
	    pageNumber:1,
		columns:[[    
			{field:'id',title:'新闻ID',width:60,resizable:false,align:'center'}, 
			{field:'title',title:'标题',width:120,resizable:false,align:'center'},
			{field:'content',title:'内容',width:120,resizable:false,align:'center'},
			{field:'createDate',title:'创建日期',width:120,resizable:false,align:'center'},
			{field:'option',title:'操作',width:60,resizable:false,align:'center',
				formatter:function(value,rowData){
		        return "<a  style='font-size:normal;color:#cc0000;cursor:pointer;' onClick=doDelete('"+rowData.id+"')>【删除】</a>&nbsp;";
					}
			}]],
		pagination:true,
	}); 
});
/**
 * 删除问答信息
 */
function doDelete(id){
        $.messager.confirm('提示信息', "您确认删除吗？", function(rf) {
            if(rf){
            	$.ajax({
            		   type: "POST",
            		   url: "deleteNewsInfo.html",
            		   data: {newsId:id},
            		   success: function(r){
            			   $.messager.alert('提示信息',r.msg,"", function () {
            				   window.location.reload();
            			   });
            		   }
            		});
            }
        });            
}
